package at.tuwien.seminar.scrum1.view.wicket.customer;

import at.tuwien.seminar.scrum1.model.Customer;
import at.tuwien.seminar.scrum1.model.Room;
import at.tuwien.seminar.scrum1.proxies.ReservationProxy;
import at.tuwien.seminar.scrum1.view.reservation.list.ReservationList;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

public class ReservationActionPanel extends Panel
{
    /**
     * @param id
     *            component id
     * @param model
     *            model for contact
     */
    public ReservationActionPanel(String id, final IModel<Customer> model)
    {
        super(id, model);
        add(new Link("select")
        {
            @Override
            public void onClick()
            {

                 setResponsePage(new ReservationList(ReservationProxy.getInstance().getReservationByCustomer(model.getObject())));
            }
        });
    }
}
